Skip to content

One-word filter labels with counts; add Genre & Awards facets#13

Merged
700799 merged 1 commit into
claude/category-scroll-filterfrom
claude/filter-facets-counts
May 30, 2026
Merged

One-word filter labels with counts; add Genre & Awards facets#13
700799 merged 1 commit into
claude/category-scroll-filterfrom
claude/filter-facets-counts

Conversation

@700799

@700799 700799 commented May 30, 2026

Copy link
Copy Markdown
Owner

One-word filter labels + counts, with Genre & Awards facets

Reworks the home filter box so it uses the full width, offers more to click, and is easier to scan — addressing the screenshot where the THEME box left the right half empty with long two-word labels.

Changes

  • Three space-filling groupsTheme, Genre, Awards — each a responsive grid (grid-cols-2 sm:grid-cols-3 lg:grid-cols-4) of full-width pills, instead of one left-column Theme list.
  • One-word labels everywhere (Power, Identity, Dystopian, Gothic, Pulitzer, Booker…), with the full name on hover (title=).
  • Book count badge on every pill (e.g. Pulitzer · 8, Booker · 3).
  • New Awards facet derived from the existing book.awards data — buckets for Pulitzer, Booker, National Book Award, Newbery, and NYT Bestseller. Adds ActiveFilters.award, an awardOk clause in filterBooks, and facetOptions()/canonicalAwards()/allAwards() helpers in src/lib/filters.ts.
  • Header category row now uses the same one-word labels with counts.

Note on "motifs": per-book motifs (e.g. "the green light," "the conch") are unique to each book, so they can't act as a shared filter — Awards is the meaningful facet that fits the existing data, so I added that instead.

Files

src/lib/filters.ts (short labels, awards facet, counts, ActiveFilters.award), src/components/Pill.tsx (count badge + full-width variant), src/components/FilterPills.tsx (grouped grids), src/components/CategoryNav.tsx (one-word + counts).

Verify

  • npm run build succeeds (50 routes export); the PR build CI job runs it too.
  • Confirmed: three group headings render; one-word labels with full names in title=; count badges (Pulitzer=8, Booker=3 verified); all award labels present; category row uses short labels on home and guide pages.

Note on base branch

This builds on top of #12 (category filter/scroll), so it's targeted at that branch for a clean diff; it will retarget to main automatically once #12 merges.

https://claude.ai/code/session_01Egnnw9v4T3ppsAQveFnijo


Generated by Claude Code

Rework the home filter box to use the full width and offer more to click:
- Three grouped, space-filling grids (Theme, Genre, Awards) instead of a
  single left-column Theme list
- One-word labels everywhere (Power, Dystopian, Pulitzer, …) with the full
  canonical name on hover (title=)
- A book count badge on every pill
- New Awards facet derived from existing book.awards (Pulitzer, Booker,
  National, Newbery, Bestseller); adds ActiveFilters.award + filterBooks
  award clause + facetOptions()/counts helpers in filters.ts
- Header category row now uses the same one-word labels with counts

Pill gains optional count badge + full-width (block) variant.
@700799 700799 marked this pull request as ready for review May 30, 2026 22:02
@700799 700799 merged commit 3ab89f4 into claude/category-scroll-filter May 30, 2026
1 check passed
700799 added a commit that referenced this pull request May 30, 2026
…unts

Category menu now filters the grid and scrolls to it; filter box uses the full width with three groups (Theme, Genre, Awards), one-word labels, and book counts. Includes the changes from PR #13 (stacked on this branch).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants